import request from '@/config/axios'

export interface MomentTemplateVO {
        id: number
        title: string
        content: string
        sort: number
        attachmentType: number
        imgUrl: string
        linkTitle: string
        linkPicUrl: string
        linkUrl: string
        linkDesc: string
}

// 查询朋友圈模板列表
export const getMomentTemplatePage = async (params) => {
    return await request.get({url: `/wecom/moment-template/page`, params})
}

// 查询朋友圈模板详情
export const getMomentTemplate = async (id: number) => {
    return await request.get({url: `/wecom/moment-template/get?id=` + id})
}

// 新增朋友圈模板
export const createMomentTemplate = async (data: MomentTemplateVO) => {
    return await request.post({url: `/wecom/moment-template/create`, data})
}

// 修改朋友圈模板
export const updateMomentTemplate = async (data: MomentTemplateVO) => {
    return await request.put({url: `/wecom/moment-template/update`, data})
}

// 删除朋友圈模板
export const deleteMomentTemplate = async (id: number) => {
    return await request.delete({url: `/wecom/moment-template/delete?id=` + id})
}

// 导出朋友圈模板 Excel
export const exportMomentTemplate = async (params) => {
    return await request.download({url: `/wecom/moment-template/export-excel`, params})
}